﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MMS.Service
{
    public partial class Employee:IService.IEmployee
    {
        #region 1.0 根据用户id查询用户权限集合 +List<MODEL.Permission> GetUserPermission(int uid)
        /// <summary>
        /// 1.0 根据用户id查询用户权限集合
        /// </summary>
        /// <param name="uid">用户id</param>
        /// <returns></returns>
        public List<Model.Permission> GetUserPermission(int uid)
        {
           
               
            //1.根据用户id查 集合
            List<int?> listPerIds = base.DBSession.EmpPerRelation.Where(o => o.EPEmpId == uid&&o.EPIsDel==false).Select(o => o.EPPerId).ToList();
          
            return base.DBSession.Permission.Where(o => listPerIds.Contains(o.PerId)&&o.PerIsDel==false).ToList().Select(o => o.ToPOCO()).ToList();
        } 
        #endregion
    }
}
